package com.tulun.service;

import com.tulun.Config.SysConfig;

import javax.swing.*;
import java.awt.*;

public class SettingService extends JFrame {
    //获取主屏幕大小
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();


    public SettingService() {
        super.setTitle("定时任务调度平台");
        this.setSize(SysConfig.SCREEN_WIDTH, SysConfig.SCREEN_HIGHT);
        this.setLocation((screenSize.width - SysConfig.PHOTO_WIDTH) / 2, (screenSize.height - SysConfig.PHOTO_HIGHT) / 2);
        //窗口大小可否调动
        this.setResizable(false);
        //单击窗口关闭按钮执行的操作
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        //窗口显示在最前面
        this.setVisible(true);

        JPanel panel=new JPanel();
        panel.setAlignmentX(this.getAlignmentX()+10);
        panel.setAlignmentY(this.getAlignmentY()+10);

        //圖形界面
        final JTextField name=new JTextField(10);
        JLabel namelabel=new JLabel("用戶名");
        namelabel.setBounds(70, 80, 120, 20);
        name.setBounds(220, 80, 300, 300);
        name.setFont(new Font("宋体", Font.PLAIN, 26));

        panel.add(namelabel);
        panel.add(name);

        this.add(panel);
    }
}
